# 输入文本，包含GEN_WR命令
input_text = """
initial version 0x01
FPGA_INI();
delayms_pc(10);
ini_ssd2828();
delayms_pc(1000);
//IC:FT8057
//BOE B3 6.58 720x1600 LongV 60Hz

//----------------------LCD initial code Start----------------------//
//--------------CMD WR enable--------------//
GEN_WR(0x00,0x00);
GEN_WR(0xFF,0x80,0x57,0x01);
"""


# 定义一个函数来提取GEN_WR命令的参数
def extract_gen_wr_params(line):
    start_idx = line.find("GEN_WR(")
    if start_idx == -1:
        return None

    start_idx += len("GEN_WR(")
    end_idx = line.find(");", start_idx)
    if end_idx == -1:
        return None

    params_str = line[start_idx:end_idx].strip()
    params = params_str.split(',')
    params = [p.strip() for p in params]
    return params


# 按行处理输入文本，提取GEN_WR命令的参数
lines = input_text.splitlines()
gen_wr_params = []
for line in lines:
    params = extract_gen_wr_params(line)
    if params:
        gen_wr_params.append(params)

# 输出提取的GEN_WR命令参数
print(f"Found {len(gen_wr_params)} matches:")
for params in gen_wr_params:
    print(params)